<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8" import="java.util.Date"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<%
	Date d = new Date();
	Long time = d.getTime();
%>
<html>
	<head>
		<title>前台管理--活动管理--编辑活动</title>
		<link href="${ctx}/css/safeai/together.css" rel="stylesheet"
			type="text/css">
	</head>

	<body>

		<form method="post" action="${ctx }/article/articleManage.do"
			name="articleForm" enctype="multipart/form-data">
			<input type="hidden" name="method" value="update" />
			<logic:present name="article">
				<input type="hidden" name="article.atype" value="${article.atype}" />
				<input type="hidden" name="article.pid" value="${article.pid}" />
				<input type="hidden" name="article.id" value="${article.id}" />
				<input type="hidden" name="article.publisher"
					value="${article.publisher}" />
				<input type="hidden" name="article.del" value="${article.del}" />

				<table align="center" width="700px">
					<tr>
						<th colspan="2" height="25px">
							编辑活动
						</th>
					<tr>
						<td class="td_01">
							标题：
						</td>
						<td class="td_edit">
							<input type="text" name="article.title" value="${article.title}" />
						</td>
					</tr>
					<tr>
						<td nowrap class="td_01">
							图片
						</td>
						<td colspan="3" class="td_02">
							<a href="javaScript:void(0);"> <img height="80"
									src="${ctx}${article.imagedesc}?time=<%=time%>" width="80" />
							</a>&nbsp;&nbsp;
							<span style="color: red;">注：图片尺寸：
								500*500,格式为：.JPG,大小为：10Mb</span>
							<br>
							<input type="file" value="${article.image1File}"
								name="article.image1File"
								onkeypress="alert('不允许手工填写'); window.event.returnValue=false;" />
							<input type="hidden" value="${article.imagedesc}" name="oldImage" />
							<br />
							<font color="red">${file1}</font>
						</td>
					</tr>
					<tr>
						<td class="td_01">
							简介：
						</td>
						<td  class="td_02">
							<textarea name="article.summaryinfo" cols="70" rows="5">${article.summaryinfo}</textarea>
						</td>
					</tr>
					<tr>
						<td class="td_01">
							顺序：
						</td>
						<td class="td_edit">
							<input type="text" name="article.sequence"
								value="${article.sequence}" id="sequence"
								onchange="javascript:testisNum('sequence')" />
						</td>
					</tr>
					<tr>
					<td class="td_01">
						网站地址：
					</td>
					<td class="td_edit">
						<input type="text" name="article.urllink" value="${article.urllink }" />
					</td>
				</tr>
				<tr>
					<td class="td_01">
						原文地址：
					</td>
					<td class="td_edit">
						<input type="text" name="article.originalurllink" value="${article.originalurllink }" />
					</td>
				</tr>
					<tr>
						<td class="td_01">
							内容：
						</td>
						<td class="td_03">
							<FCK:editor id="article.content" basePath="${ctx}/FCKeditor/"
								width="90%" height="390px" defaultLanguage="zh-cn" tabSpaces="8"
								toolbarSet="catalog"
								imageBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
								linkBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
								flashBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
								imageUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
								linkUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
								flashUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
							${article.content}
		  				</FCK:editor>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="td_01">
							<input name="submit" class="btn" type="submit" value="提交">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type="button" class="btn" name="return" value="返回"
								onmousedown="javascript:history.go(-1);" />
						</td>
					</tr>
				</table>
			</logic:present>
		</form>
	</body>
	<script type="text/javascript">
	function submitInfo()
	{
		document.forms['articleForm'].submit();
	}
	
	 function testisNum(id){
	 var object=document.getElementById(id);
      var s =document.getElementById(object.id).value;
          if(s!=""){
             if(isNaN(s)){
                 alert("请输入数字");
                 object.value=0;
                 object.focus();
                 return;
             }
          }else{
                 alert("此处不能为空！默认值为0！");
                 object.value=0;
                 object.focus();
                 return;
          }
   }
   //获得内容控件
   var objContent=document.getElementById("article.content");
   objContent.onchange=function(){
       var str=objContent.value;
       str=bb(aa(str));
       objContent.value=str;
   }
  function aa(str){
        return   str.replace(/^[\s]+/,"");   
  }     
  function bb(str){
        return   str.replace(/[\s]+$/,"");
  }  
	</script>
</html>
